﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SheepClock
{
    public class MyAlarm
    {
        public MyAlarm()
        {
            ID = Guid.NewGuid().ToString();
        }

        public MyAlarm(string line)
            : this()
        {
            string[] tokens = line.Split((char)9);
            ID = tokens[0];
            Name = tokens[1];
            Hours = Convert.ToInt32(tokens[2]);
            Minutes = Convert.ToInt32(tokens[3]);
            IsON = Convert.ToBoolean(tokens[4]);
        }

        public string ID
        {
            get;
            set;
        }
        public string Name
        {
            get;
            set;
        }
        public int Hours
        {
            get;
            set;
        }
        public int Minutes
        {
            get;
            set;
        }
        public bool IsON
        {
            get;
            set;
        }

        public override string ToString()
        {
            return ID
                + ((char)9) + Name
                + ((char)9) + Hours.ToString()
                + ((char)9) + Minutes.ToString()
                + ((char)9) + IsON.ToString();
        }

    }
}